<template>
  <div id="app">
    <!-- <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link>
    </div>
    <router-view/> -->
    <keep-alive :max="10">
      <router-view v-if="$route.meta.keepAlive" />
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive" />
    <loading v-show="loading"></loading>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "App",
  computed: {
    ...mapState({
      loading: state => state.common.loading
    })
  }
};
</script>
<style lang="scss">
 *{
   margin: 0;
   padding: 0;
 }
  body, html, #app{
    width: 100%;
    height: 100%;
  }
</style>
